﻿namespace Build.Test
{
	using System.Collections.Generic;
	using System.IO;

	using Microsoft.Build.BuildEngine;
	using Microsoft.Build.Evaluation;
	using Microsoft.VisualStudio.TestTools.UnitTesting;

	[TestClass]
	public class CustomWorkFlowTaskTest
	{
		public TestContext TestContext
		{
			get;
			set;
		}

		[TestMethod]
		////[ExpectedException(typeof(ArgumentException))]
		public void TestWorkFlow()
		{
			var solutionDirectory = new System.IO.DirectoryInfo(TestContext.TestRunDirectory).Parent.Parent;

			var properties =
				new Dictionary<string, string>
					{
						{ "OutDir", @"C:\Builds\1\BuildLab\BuildLab\Sources\BuildTest\Main" },
						{ "SolutionDir", solutionDirectory.Parent.FullName }
					};

			var buildScriptFile = Path.Combine(solutionDirectory.FullName, "Solution", "Build.proj");

			new ProjectCollection(properties)
				.LoadProject(buildScriptFile)
				.Build();
		}
	}
}